From: Florian Müllner Date: Thu, 2 Apr 2020 10:42:41 +0000 (+0200) Subject: bluetooth: Fix infinite loop X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~556 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5067bda61a6a27a14aab7fa7482b8f305699cf96;p=gnome-shell.git bluetooth: Fix infinite loop Bailing out early of the loop means the iter is never increased, resulting in an infinite loop. Fixes 26c2cb9f6. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1165 --- diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index ab167be02..04a6d5ae2 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -84,15 +84,14 @@ class Indicator extends PanelMenu.SystemIndicator { const isTrusted = this._model.get_value(iter, GnomeBluetooth.Column.TRUSTED); - if (!isPaired && !isTrusted) - continue; - - deviceInfos.push({ - connected: this._model.get_value(iter, - GnomeBluetooth.Column.CONNECTED), - name: this._model.get_value(iter, - GnomeBluetooth.Column.ALIAS), - }); + if (isPaired || isTrusted) { + deviceInfos.push({ + connected: this._model.get_value(iter, + GnomeBluetooth.Column.CONNECTED), + name: this._model.get_value(iter, + GnomeBluetooth.Column.ALIAS), + }); + } ret = this._model.iter_next(iter); }